package org.erp.store.controller;

import org.erp.common.domain.Result;
import org.erp.store.domain.dto.DeviceRemarkDto;
import org.erp.store.service.DeviceRemarkLogicService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
/**
 * 设备备注控制器
 *
 * @author dingding
 * @since 2025-11-12
 */
@RestController
@RequestMapping("/device/remark")
public class DeviceRemarkController {

    @Resource
    private DeviceRemarkLogicService deviceRemarkLogicService;


    /**
     * 新增设备备注
     */
    @PostMapping("/add")
    public Result<Boolean> addDeviceRemark(@RequestBody DeviceRemarkDto deviceRemarkDto) {
        boolean result = deviceRemarkLogicService.addDeviceRemark(deviceRemarkDto);
        return result ? Result.success("操作成功"): Result.error("操作失败");
    }
    /**
     * 修改设备备注
     */
    @PostMapping("/upd")
    public Result<Boolean> updDeviceRemark(@RequestBody DeviceRemarkDto deviceRemarkDto) {
        boolean result = deviceRemarkLogicService.updDeviceRemark(deviceRemarkDto);
        return result ? Result.success("操作成功"): Result.error("操作失败");
    }


}
